/**
 * Labox有限公司项目InnovationServer
 * Labox版权所有 @copyright 2009
 * @javaclass LoginPackerHandler.java @author 丁宁 @time 2009-11-27
 */
package labox.innovation.loginserver.http;

import java.io.IOException;
import java.net.InetSocketAddress;

import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;

/**
 * @author Administrator
 *
 */
public abstract class IPacketHandler implements HttpHandler{
	
	public void handle(HttpExchange t) throws IOException {
		if(accept(t.getRemoteAddress())){
			run(t);
		}
		t.close();
	}
	
	public abstract void run(HttpExchange t);
	
	public abstract boolean accept(InetSocketAddress address);
}
